﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Enterprise.Management.Gridview
{
    public class GridviewHeader
    {
        public GridviewHeaderCell Last
        {
            get
            {
                if (Cells.Count <= 0) return null;
                return Cells[Cells.Count - 1];
            }
        }
        public List<GridviewHeaderCell> Cells { get; set; }

        public GridviewHeader()
        {
            Cells = new List<GridviewHeaderCell>();
        }

        public void Add(string headerName)
        {
            Add(headerName, string.Empty);
        }

        public void Add(string headerName, string rowName)
        {
            Cells.Add(new GridviewHeaderCell()
            {
                Value = headerName,
                RowValue = rowName
            });
        }
    }
}